package com.dc.entity.special;


import com.dc.entity.WorkflowPaintHouseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 *  6-1-涂装喷漆-喷漆房分段喷漆  单船工序   子表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_workflow_special_1_paint_house_child")
public class WorkflowSpecial1PaintHouseChildEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "device", length = 50)
    private String device;          // 设备


    @Column(name = "start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startTime;         // 开始时间

    @Column(name = "end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endTime;           // 结束时间

    @Column(name = "num")
    private Integer num;            // 数量

    @Column(name = "unit", length = 10)
    private String unit;            // 单位

    @Column(name = "power")
    public Double power;           // 设备功率(KW)

    @Column(name = "total_power")
    public Double totalPower;      // 总有功电能(KWH)


    @Column(name = "workflow_paint_house_id", insertable = false, updatable = false)
    private Long pid;     // 传递 workflow_paint_house_id 参数

//    // persist对级联新增有影响，remove对级联删除有影响，merge对级联修改有影响，refresh对级联查询有影响
//    @JsonIgnoreProperties(value = { "inner" })
//    @JsonIgnore
//    @ManyToOne()
//    @JoinColumn(name = "workflow_paint_house_id", referencedColumnName = "id")
//    private WorkflowSpecial1PaintHouseEntity workflowPaintHouseEntity;

}
